<template>
  <div class="m">
    <div style="width: 320px; margin-right: 20px">
      <div style="height: 194px" class="comp">
        <Lunbo></Lunbo>
        <!-- <img src="..\assets\zhyq\监控视频轮播.png" /> -->
      </div>
      <div style="height: 320px" class="comp">
        <div class="title">
          入园统计
          <el-button type="text" class="more">更多 ></el-button>
        </div>
        <div class="tongji">
          <div class="tongji-biaoqian">
            <img src="..\assets\zhyq\che\员工车辆.png" />
            <div>
              员工车辆
              <p>300</p>
            </div>
          </div>
          <div class="tongji-biaoqian">
            <img src="..\assets\zhyq\che\访客车辆.png" />
            <div>
              访客车辆
              <p>50</p>
            </div>
          </div>
          <div class="tongji-biaoqian">
            <img src="..\assets\zhyq\che\运输车辆.png" />
            <div>
              运输车辆
              <p>20</p>
            </div>
          </div>
          <div class="tongji-biaoqian">
            <img src="..\assets\zhyq\che\施工车辆.png" />
            <div>
              施工车辆
              <p>20</p>
            </div>
          </div>
          <div class="tongji-biaoqian">
            <img src="..\assets\zhyq\che\其他.png" />
            <div>
              其他
              <p>10</p>
            </div>
          </div>
        </div>
      </div>
      <div style="height: 130px" class="comp">
        <div class="title">
          车辆检测
          <el-button type="text" class="more">更多 ></el-button>
          <div class="jiance">
            <div class="jiance-biaoqian">
              <el-badge :value="8" class="black">
                <img src="..\assets\zhyq\che\车辆-黑名单.png" />
              </el-badge>
              <p>黑名单</p>
            </div>
            <div class="jiance-biaoqian">
              <el-badge :value="8" class="white">
                <img src="..\assets\zhyq\che\车辆-白名单.png" />
              </el-badge>
              <p>白名单</p>
            </div>
            <div class="jiance-biaoqian">
              <el-badge :value="8" class="yellow">
                <img src="..\assets\zhyq\che\车辆-违规车辆.png" />
              </el-badge>
              <p>违规车辆</p>
            </div>
          </div>
        </div>
      </div>
      <div style="height: 230px" class="comp">
        <div class="title">
          车位存量
          <el-button type="text" class="more">更多 ></el-button>
        </div>
        <div>
          <span class="danqian"
            >当前车位 <span style="color: #1af7ff">150/400</span></span
          >
          <span class="shiyonglv"
            >35.5% <span style="color: #fff">使用率</span></span
          >
        </div>
        <div style="width: 100%; height: 158px" id="Bar"></div>
      </div>
    </div>
    <div style="width: 1206px">
      <img src="..\assets\cysj\车辆路线.png" class="luxian" />
      <div style="height: 604px">
        <div style="width: 30px; margin-top: 60px">
          <el-button type="text" class="map-button">
            <img src="..\assets\cysj\车辆按钮.png"
          /></el-button>
        </div>
      </div>
      <div style="height: 194px" class="comp">
        <img src="..\assets\zhyq\总览最新事件.png" />
      </div>
    </div>
    <div style="width: 319px !important; margin-left: 20px">
      <div style="height: 177px" class="comp">
        <div class="title">历史告警</div>
        <div style="width: 100%; height: 158px" id="Bar2"></div>
      </div>
      <div style="height: 201px" class="comp">
        <img src="..\assets\zhyq\che\今日车流量.png" />
      </div>
      <div style="height: 185px" class="comp">
        <img src="..\assets\zhyq\che\离场时间.png" />
      </div>
      <div style="height: 310px" class="comp">
        <img src="..\assets\zhyq\che\车辆查询.png" />
      </div>
    </div>
  </div>
</template>

<script >
import Lunbo from "@/components/zhyq/Lunbo.vue";
export default {
  components: {
    Lunbo,
  },
  mounted() {
    this.drawBar();
    this.drawBar2();
  },
  methods: {
    drawBar() {
      let myCHart = this.$echarts.init(document.getElementById("Bar"));
      let option = {
        xAxis: {
          type: "value",
          show: false,
        },
        yAxis: {
          data: ["东四", "东三", "东二", "东一"],
          axisLabel: {
            textStyle: {
              color: "#fff",
            },
          },
          axisLine: {
            lineStyle: { color: "#fff" },
          },
          axisTick: {
            show: false,
          },
        },
        grid: {
          bottom: "10px",
          left: "45px",
          top: "10px",
        },
        series: [
          {
            type: "bar",
            showBackground: true,
            backgroundStyle: {
              color: "rgba(180, 180, 180, 0.2)",
            },
            data: [45, 15, 23, 36],
            barWidth: "25%",
            itemStyle: {
              color: "#0192ed",
            },
          },
        ],
      };
      myCHart.setOption(option);
    },
    drawBar2() {
      let myCHart = this.$echarts.init(document.getElementById("Bar2"));
      let option = {
        grid: {
          top: 35,
          bottom: 40,
        },
        legend: {
          right: 10,
          itemWidth: 12,
          itemHeight: 12,
          icon: "rect",
          data: ["黑名单", "违规人员"],
          textStyle: {
            color: "#ffffff",
            fontSize: 12,
          },
        },
        xAxis: {
          name: "时",
          nameTextStyle: { color: "#fff" },
          data: [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
          splitLine: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisTick: { show: false },
          axisLabel: {
            textStyle: {
              color: "#ffffff",
              fontSize: 12,
            },
          },
        },
        yAxis: {
          name: "人",
          nameTextStyle: { color: "#fff" },
          axisLine: {
            show: false,
          },
          splitLine: {
            lineStyle: {
              color: "#555",
            },
          },
          axisTick: {
            show: false,
          },
          axisLabel: {
            textStyle: {
              color: "#ffffff",
              fontSize: 12,
            },
          },
        },
        series: [
          {
            name: "黑名单",
            type: "bar",
            stack: "黑名单",
            data: [12, 6, 25, 18, 9, 0, 19, 16, 8, 18, 22, 17, 16, 2],
            barWidth: 10,
            stack: "1",
            itemStyle: {
              color: "#0192ed",
            },
          },
          {
            name: "违规人员",
            type: "bar",
            data: [12, 6, 25, 18, 9, 0, 19, 16, 8, 18, 22, 17, 16, 2],
            stack: "1",
            itemStyle: {
              color: "#e67150",
            },
          },
        ],
      };
      myCHart.setOption(option);
    },
  },
};
</script>

<style lang="less" scoped>
.m {
  display: flex;
  width: 1880px;
  background-image: url("../assets/zhyq/背景地图.png");
}
.comp {
  margin: 20px 0;
  border: 1px solid #3c6fd2;
  background-color: #111e4b;
}
/deep/.el-button + .el-button {
  margin-left: 0px;
}
/deep/ .map-button {
  padding: 0px 20px;
}
.title {
  color: #1af7ff;
  text-align: left;
  font-size: 16px;
  padding-left: 10px;
  background-image: url(../assets/image/当前检测-标题-背景图片.png);
  background-repeat: no-repeat;
  background-size: 171px 30px;
  line-height: 30px;
  height: 30px;
  font-weight: bold;
}
/deep/.more {
  color: #ffffff;
  float: right;
  margin-right: 10px;
  line-height: 10px;
}
.luxian {
  position: absolute;
  left: 38%;
  bottom: 45%;
}
/*入园统计*/
.tongji-biaoqian {
  background-image: url(../assets/zhyq/che/统计.png);
  background-repeat: no-repeat;
  background-size: 166px 98px;
  color: #ffffff;
  font-size: 18px;
  flex: 0 0 155px;
}
.tongji {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}
.tongji-biaoqian > img {
  float: left;
  margin: 28px 0 0 20px;
}
.tongji-biaoqian > div {
  float: right;
  width: 84px;
  margin: 24px 0 0 0;
}
.tongji-biaoqian p {
  color: #1af7ff;
}

/*车辆检测*/
.jiance-biaoqian {
  color: #ffffff;
  margin-top: 20px;
  text-align: center;
}
.jiance {
  display: flex;
  justify-content: space-around;
  width: 100%;
}
/deep/.black .el-badge__content {
  color: #0192ed;
  background-color: transparent;
  border: 0px;
  font-size: 18px;
}
/deep/.white .el-badge__content {
  color: #fee860;
  background-color: transparent;
  border: 0px;
  font-size: 18px;
}
/deep/.yellow .el-badge__content {
  color: #e67150;
  background-color: transparent;
  border: 0px;
  font-size: 18px;
}
/*车位存量*/
.danqian {
  background-image: url(../assets/zhyq/che/统计.png);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 5px 20px;
  margin: 5px 0;
  display: inline-block;
  font-size: 12px;
  color: #ffffff;
}
.shiyonglv {
  font-size: 12px;
  color: #1af7ff;
  padding: 5px 0;
  margin: 5px 0;
  display: inline-block;
}
</style>
